
insert_at(A,L,1,[A|L]):-!.
insert_at(A,[X|Xs],N,[X|Ys]):-
    N1 is N - 1,
    insert_at(A,Xs,N1,Ys).